/**
 * @file 放置一些公共模块样式
 * @auth jinguangguo
 * @date 2016/10/19
 */

.m-loading {
    display: inline-block;
    height: 16px;
    text-align: center;
    font-size: 0;
    > .rect {
        display: inline-block;
        margin-right: 4px;
        height: 100%;
        width: 2px;
        background-color: #ddd;
        border: 1px solid #ddd;
        border-radius: 4px;
        -webkit-animation: sk-stretchdelay 1.2s infinite ease-in-out;
        animation: sk-stretchdelay 1.2s infinite ease-in-out;
        &:last-child {
            margin-right: 0;
        }
    }
    > .rect2 {
        -webkit-animation-delay: -1.1s;
        animation-delay: -1.1s;
    }
    > .rect3 {
        -webkit-animation-delay: -1.0s;
        animation-delay: -1.0s;
    }
    > .rect4 {
        -webkit-animation-delay: -0.9s;
        animation-delay: -0.9s;
    }
    > .rect5 {
        -webkit-animation-delay: -0.8s;
        animation-delay: -0.8s;
    }
    @-webkit-keyframes sk-stretchdelay {
        0%, 40%, 100% {
            -webkit-transform: scaleY(0.4)
        }
        20% {
            -webkit-transform: scaleY(1.0)
        }
    }
    @keyframes sk-stretchdelay {
        0%, 40%, 100% {
            transform: scaleY(0.4);
            -webkit-transform: scaleY(0.4);
        }
        20% {
            transform: scaleY(1.0);
            -webkit-transform: scaleY(1.0);
        }
    }
}

.m-loading-point {

    > .bounce {
        display: inline-block;
        width: 8px;
        height: 8px;
        background-color: #ddd;
        border-radius: 100%;
        -webkit-animation: sk-bouncedelay 1.4s infinite ease-in-out both;
        animation: sk-bouncedelay 1.4s infinite ease-in-out both;
    }

    > .bounce1 {
        -webkit-animation-delay: -0.32s;
        animation-delay: -0.32s;
    }
    > .bounce2 {
        -webkit-animation-delay: -0.16s;
        animation-delay: -0.16s;
    }
    > .bounce3 {

    }

    @-webkit-keyframes sk-bouncedelay {
        0%, 80%, 100% {
            -webkit-transform: scale(0)
        }
        40% {
            -webkit-transform: scale(1.0)
        }
    }

    @keyframes sk-bouncedelay {
        0%, 80%, 100% {
            -webkit-transform: scale(0);
            transform: scale(0);
        }
        40% {
            -webkit-transform: scale(1.0);
            transform: scale(1.0);
        }
    }

}

.m-loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    position: relative;
    text-align: center;
    -webkit-animation: sk-rotate 2.0s infinite linear;
    animation: sk-rotate 2.0s infinite linear;

    .dot1 {
        width: 60%;
        height: 60%;
        display: inline-block;
        position: absolute;
        top: 0;
        background-color: #ddd;
        border-radius: 100%;
        -webkit-animation: sk-bounce 2.0s infinite ease-in-out;
        animation: sk-bounce 2.0s infinite ease-in-out;
    }

    .dot2 {
        width: 60%;
        height: 60%;
        display: inline-block;
        position: absolute;
        background-color: #bbb;
        border-radius: 100%;
        -webkit-animation: sk-bounce 2.0s infinite ease-in-out;
        animation: sk-bounce 2.0s infinite ease-in-out;
        top: auto;
        bottom: 0;
        -webkit-animation-delay: -1.0s;
        animation-delay: -1.0s;
    }
}

@-webkit-keyframes sk-rotate {
    100% {
        -webkit-transform: rotate(360deg);
    }
}


@keyframes sk-rotate {
    100% {
        transform: rotate(360deg);
        -webkit-transform: rotate(360deg);
    }
}


@-webkit-keyframes sk-bounce {
    0%, 100% {
        -webkit-transform: scale(0);
    }

    50% {
        -webkit-transform: scale(1);
    }
}


@keyframes sk-bounce {
    0%, 100% {
        transform: scale(0);
        -webkit-transform: scale(0);
    }

    50% {
        transform: scale(1);
        -webkit-transform: scale(1);
    }
}

.m-loading-cube {
    display: inline-block;
    width: 24px;
    height: 24px;
    transform: rotate(45deg);
    .sk-cube {
        float: left;
        width: 50%;
        height: 50%;
        position: relative;
        -webkit-transform: scale(1.1);
        -ms-transform: scale(1.1);
        transform: scale(1.1);
        &:before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: #cccdcd;
            -webkit-animation: sk-foldCubeAngle 2.4s infinite linear both;
            animation: sk-foldCubeAngle 2.4s infinite linear both;
            -webkit-transform-origin: 100% 100%;
            -ms-transform-origin: 100% 100%;
            transform-origin: 100% 100%;
        }
    }
    .sk-cube2 {
        -webkit-transform: scale(1.1) rotateZ(90deg);
        transform: scale(1.1) rotateZ(90deg);
    }
    .sk-cube3 {
        -webkit-transform: scale(1.1) rotateZ(180deg);
        transform: scale(1.1) rotateZ(180deg);
    }
    .sk-cube4 {
        -webkit-transform: scale(1.1) rotateZ(270deg);
        transform: scale(1.1) rotateZ(270deg);
    }
    .sk-cube2:before {
        -webkit-animation-delay: 0.3s;
        animation-delay: 0.3s;
    }
    .sk-cube3:before {
        -webkit-animation-delay: 0.6s;
        animation-delay: 0.6s;
    }
    .sk-cube4:before {
        -webkit-animation-delay: 0.9s;
        animation-delay: 0.9s;
    }
}

@-webkit-keyframes sk-foldCubeAngle {
    0%, 10% {
        -webkit-transform: perspective(140px) rotateX(-180deg);
        transform: perspective(140px) rotateX(-180deg);
        opacity: 0;
    }

    25%, 75% {
        -webkit-transform: perspective(140px) rotateX(0deg);
        transform: perspective(140px) rotateX(0deg);
        opacity: 1;
    }

    90%, 100% {
        -webkit-transform: perspective(140px) rotateY(180deg);
        transform: perspective(140px) rotateY(180deg);
        opacity: 0;
    }
}


@keyframes sk-foldCubeAngle {
    0%, 10% {
        -webkit-transform: perspective(140px) rotateX(-180deg);
        transform: perspective(140px) rotateX(-180deg);
        opacity: 0;
    }

    25%, 75% {
        -webkit-transform: perspective(140px) rotateX(0deg);
        transform: perspective(140px) rotateX(0deg);
        opacity: 1;
    }

    90%, 100% {
        -webkit-transform: perspective(140px) rotateY(180deg);
        transform: perspective(140px) rotateY(180deg);
        opacity: 0;
    }
}

.m-tab {
    position: relative;

    ul.list {
        overflow: hidden;
        li.item {
            float: left;
            margin-right: 12px;
            .item-link {
                display: block;
                padding: 4px 12px;
                background-color: #2f3132;
                color: #8c8c8c;
                &:hover {
                    cursor: pointer;
                    //color: #a0a6a9;
                }
                &--active {
                    background-color: #181a1c;
                    cursor: default;
                    pointer-events: none;
                    color:#fff;
                    &:hover {
                        color: currentColor;
                    }
                }
            }
            &:first-child {
                .item-link {
                    padding-right: 8px;
                }
            }
            &:last-child {
                .item-link {
                    padding-left: 8px;
                }
            }
        }

    }

    &--white{
        ul.list {

            li.item {

                .item-link {

                    background-color: #eaeaea;
                    color: #666;
                    &:hover {
                        cursor: pointer;
                    }
                    &--active {
                        background-color: #dddddd;
                        cursor: default;
                        pointer-events: none;
                        color: #5392b9;
                        &:hover {
                            color: currentColor;
                        }
                    }
                }
            }

        }
    }
    //&--buysell {
    //    ul.list {
    //        display: flex;
    //        li.item {
    //            float: none;
    //            flex: 1;
    //            &:first-child {
    //                .item-link--active {
    //                    border-bottom: 3px $color-green solid;
    //                }
    //            }
    //            &:last-child {
    //                .item-link--active {
    //                    border-bottom: 3px $color-orange solid;
    //                }
    //            }
    //        }
    //    }
    //}
}

.m-center-tab {
    position: relative;
    text-align: center;
    font-family: 'Microsoft YaHei', 'hiragino sans gb', 'Arial', sans-serif;
    ul.list {
        li.foot-item {
            margin-right: 20px;
            display: inline-block;
            font-size: 12px;
            .item-link {
                display: block;
                line-height: 56px;
                color: $color-font;
                &--active {
                    border-bottom: 2px #000000 solid;
                    pointer-events: none;
                }
            }
        }
    }
}

// table样式公共头部
@mixin commonTh() {
    height: 32px;
    line-height: 32px;
    background-color: inherit;
    color: $color-font-gray;
    font-weight: normal;
    font-size: 12px;
}

@mixin grayText() {
    padding: 30px 0;
    color: $color-font-gray;
    text-align: center;
}

%tr {
    //border-bottom: 1px solid $color-border;
    line-height: 22px;
    min-height: 22px;
    &:hover {
        background-color: $color-item-hover;
    }
}

@mixin tr_dark {
    table > thead {
        border-bottom: 0 none;
    }
    table >tbody >tr {
        &:hover {
            background-color: #292b2d;
        }
    }
}

.m-table-flex {
    width: 100%;
    min-height: $height-table-min;
    text-align: left;
    .tr {
        display: flex;
        align-items: center;
    }
    .th {
        @include commonTh();
    }
    .th, .td {
        flex-grow: 0;
        flex-shrink: 0;
        box-sizing: border-box;
        padding-left: 16px;
    }
    .thead {
        //border-bottom: 1px $color-border solid;
    }

    .tbody {
        .tr {
            @extend %tr;
            .td {
                line-height: 1.4;
                font-size: 12px;
                //padding-top: 14px;
                //padding-bottom: 14px;
                &:last-child {
                    padding-right: 12px;
                }
            }
            &.no-data {
                @include grayText();
            }
            //&:nth-child(2n) {
            //    background-color: $color-bg-light;
            //}
        }
        .ui-loading {
            padding: 30px 0;
        }
    }
    &--min-height{
        min-height: 120px;
    }

    &--dark {
        .tbody {
            .tr {
                &:hover {
                    background-color: #292b2d;
                }
            }
        }
    }
}

.m-table {
    min-height: $height-table-min;
    text-align: left;
    table {
        width: 100%;
        > thead {
            border-bottom: 1px #e8e8e9 solid;
            background-color: inherit;
        }
        > tbody {
            tr {
                @extend %tr;
                &:last-child {
                    //border-bottom: 0 none;
                }
                &.no-data {
                    @include grayText();
                }
            }
            .ui-loading {
                padding: 30px 0;
            }
        }
    }
    tr {

    }
    th, td {
        background-color: inherit;
        vertical-align: middle;
    }
    th:first-child, td:first-child {
        padding-left: 16px;
    }
    th:last-child, td:last-child {
        padding-right: 16px;
    }
    th {
        @include commonTh();
    }
    td {
        padding: 0 4px;
    }
    &--border {
        padding-top: 40px;
        border-top: 1px solid #e6e6e6;
    }
    &--min-height{
        min-height:491px;
    }
    &--dark {
        @include tr_dark;
    }
}

.m-left-nav {
    width: 176px;
    background-color: #ffffff;
    .title {
        position: relative;
        padding-left: 56px;
        margin: 40px 0 32px 0;
        font-size: 16px;
        color: #333333;
        line-height: 24px;
        .title-icon, .title-text {
            vertical-align: middle;
            font-weight: bold;
        }
        i, .img {
            position: absolute;
            left: 24px;
            top: 0;
            font-size: 24px;
        }
    }
    a.item-link {
        display: block;
        padding-left: 56px;
        line-height: 40px;
        font-size: 13px;;
        margin-bottom: 10px;
        color: #666;
        &:hover {
            background-color: #fafafb;
            color:#666666;
        }
        &--active {
            color: #ffffff;
            background-color: #333;
            pointer-events: none;
            &:hover {
                color: #ffffff;
                background-color: #333;
            }
        }
    }

    dl.list-parent {
        .dt {
            border-bottom: 1px $color-border solid;
            .dt-link, .dt-text {
                height: 56px;
                line-height: 56px;
                font-size: 16px;
                padding-left: 48px;
            }
            .dt-text {

            }
            .dt-link {
                display: block;
                color: #666;
                &:hover {
                    background-color: #fafafb;
                    color:#666;
                }
                &--active {
                    color: #ffffff;
                    background-color: #333;
                    pointer-events: none;
                    &:hover {
                        color: #ffffff;
                        background-color: #333;
                    }
                }
            }
            &--tree {
                position: relative;
                cursor: default;
                color: #666;
                .icon-allow-down {
                    position: absolute;
                    left: 18px;
                    top: 16px;
                    font-size: 24px;
                    color:$color-font-gray;



                    transition: transform 0.4s ease-out;
                    transform-origin: 50% 47%;
                    &--right {
                        transform: rotate(-90deg);
                    }
                }
            }
        }
        .dd {
            .dd-link {
                display: block;
                padding-left: 56px;
                line-height: 40px;
                font-size: 13px;;
                color: #666;
                &:hover {
                    background-color: #fafafb;
                    color:#666;
                }
                &--active {
                    color: #ffffff;
                    background-color: #333;
                    pointer-events: none;
                    &:hover {
                        color: #ffffff;
                        background-color: #333;
                    }
                }
            }
        }
    }
}


.m-aside-nav {
    //.title {
    //    position: relative;
    //    font-size: 16px;
    //    color: #333333;
    //    line-height: 24px;
    //    .title-icon, .title-text {
    //        vertical-align: middle;
    //        font-weight: bold;
    //    }
    //    i, .img {
    //        position: absolute;
    //        left: 24px;
    //        top: 0;
    //        font-size: 24px;
    //    }
    //}
    .list {
        padding-left: 16px;
    }
    .left-nav-item {
        border-bottom: 2px #fff solid;
        a.item-link {
            display: block;
            box-sizing: border-box;
            height: 40px;
            line-height: 40px;
            font-size: 13px;;
            padding-left: 32px;
            color: #a1a1a1;
            &:hover {
                background-color: #f4f4f4;
                color: #000;
            }
            &--active {
                color: #000;
                background-color: #f4f4f4;
                border-right: 6px $color-btn solid;
                pointer-events: none;
            }

            .icon{
                position: absolute;
                transform: translate(-200%,105%);
                color:#000;
            }
        }
        &--sub {
            a.item-link {
                padding-left: 48px;
            }
        }
    }


    dl.list-parent {
        .dt {
            .dt-link, .dt-text {
                height: 32px;
                line-height: 32px;
                margin-bottom: 16px;
                padding-left: 8px;
                font-size: 16px;
            }
            .dt-link {
                display: block;
                color: #666;
                &:hover {
                    background-color: #e9e9e9;
                }
                &--active {
                    color: #000;
                    border-right: 6px $color-btn solid;
                    pointer-events: none;
                }
            }
            &--tree {
                position: relative;
                cursor: default;
                color: #666;
                .icon-allow-down {
                    position: absolute;
                    left: -16px;
                    top: 6px;
                    font-size: 24px;
                    color: #a1a1a1;

                    transition: transform 0.4s ease-out;
                    transform-origin: 50% 47%;
                    &--right {
                        transform: rotate(-90deg);
                    }
                }
            }
        }
        .dd {
            .dd-link {
                display: block;
                padding-left: 28px;
                line-height: 32px;
                height: 32px;
                margin-bottom: 16px;
                font-size: 12px;;
                color: #a1a1a1;
                &:hover {
                    background-color: #e9e9e9;
                }
                &--active {
                    color: #000;
                    border-right: 6px $color-btn solid;
                    pointer-events: none;
                }
            }
        }
    }
}


.m-tab-sub {
    font-family: 'Microsoft YaHei', 'hiragino sans gb', 'Arial', sans-serif;
    ul.list {
        font-size: 12px;;
        li.item {
            float: left;
            margin-right: 16px;
            .item-link {
                position: relative;
                display: flex;
                align-items: center;
                padding: 4px 8px;
                border-radius: 2px;
                border: 1px solid $color-font-light;
                color: $color-font-light;
                .icon-bank {
                    color: #666;
                }
                .tab-text {
                    padding-left: 4px;
                }
                &--active {
                    border: 1px solid $color-link;
                    color: $color-link;
                    cursor: default;
                    pointer-events: none;
                    .icon-bank {
                        color: $color-link;
                    }
                    &:hover {
                        color: currentColor;
                    }
                    .tab-text {
                        .triangle {
                            width: 12px;
                            height: 12px;
                            position: absolute;
                            top: 0;
                            right: 0;
                            background-image: url("../img/check.png");
                        }
                    }
                }
            }
        }
    }
}

// 暂应用于 财务中心->果仁地址管理 界面
.m-panel {
    border-radius: 2px;
    border: 1px solid $color-border;
    @include shadow;
    font-size: 13px;;
    > .title {
        background-color: #f8f8f8;
        padding: 0 24px;
        height: 40px;
        line-height: 40px;
    }
    > .content {
        padding: 0 24px;
        height: 64px;
        line-height: 64px;
        background-color: #fff;
        font-weight: bold;
    }
}

.m-form-dialog, .m-form-page {
    .comp-help {
        margin-bottom: 24px;
    }

    .col-row {
        //display: flex;
        margin-bottom: 16px;
        line-height: 12px;
        &-line {
            margin-bottom: 24px;
            border-bottom: 1px #c5c5c5 dashed;
        }
        &:after {
            content: "";
            display: table;
            clear: both;
        }
        &:last-child {
            margin-bottom: 0;
        }
        .ui-tip {
            margin-top: 2px;
            font-size: 12px;
            //white-space: nowrap;
        }
        &--btns {
            margin-top: 24px;
        }
    }

    .col-rowheight {
        margin-bottom: 32px;
    }

    .col-label {
        float: left;
        box-sizing: border-box;
        //padding-top: 10px;
        line-height: 32px;
        margin-right: 10px;
        text-align: right;
        color: $color-label;
    }

    .col-input, .col-text {
        float: left;
        .comp-verify-code {
            float: right;
            width: 120px;
        }
    }

    .col-text {
        > .text {
            display: block;
            min-height: 40px;
            line-height: 40px;
        }
    }

    .col-suffix {
        padding-left: 4px;
        height: 32px;
        line-height: 32px;
    }

    .col-tip {
        float: left;
        padding-top: 10px;
        padding-left: 16px;
        .icon, .link {
            vertical-align: middle;
            margin-right: 4px;
        }
        .icon {
            font-size: 15px;
        }
    }
}

//input{
//color: #cccdcd;
//}
// login register reset页面

input:-webkit-autofill {
    background-color: inherit!important;
}

.m-form-login{
    input{
        display: block;
        width: 100%;
        padding: 0;
        color: #fff;
        background-color: inherit;
        border-radius: 0;
        border: 0;
        border-bottom: 1px solid #8a8d9a;

        //padding: 0 16px;
        //color: #333;
        //border: 1px solid $color-input-border;
        //box-shadow: 0 0 0 1000px white inset;
        //background-color: #fff;
        &:hover{
            outline-offset: 0;
            color: #fff;
            background-color: inherit;
            border-radius: 0;
            border: 0;
            border-bottom: 1px solid #8a8d9a;
        }
        &:focus{
            outline-offset: 0;
            color: #fff;
            background-color: inherit;
            border-radius: 0;
            border: 0;
            border-bottom: 1px solid #8a8d9a;
        }
        &:active{
            outline-offset: 0;
            color: #fff;
            background-color: inherit;
            border-radius: 0;
            border: 0;
            border-bottom: 1px solid #8a8d9a;
        }

        @include placehold-color(#bbb);

        &.fn-input-error {
            border-bottom: 1px #f9504b solid;
        }

    }

    .fn-flex{
        display: flex;
        align-items: center;
        justify-content: center;
        flex-wrap: wrap;
        >.row-title{
            width: 100%;
            margin-bottom: 8px;
            font-family: initial;
            font-weight: bold;
            font-size: 13px;;
            color: #5b5d65;
        }
        >.ui-tip{
            width: 100%;
        }
    }

    .col-row{
        position: relative;
        >.row-title{
            display: block;
            width: 100%;
            margin-bottom: 8px;
            font-family: initial;
            font-weight: bold;
            font-size: 13px;;
            color: #5b5d65;
        }
        &:last-child{
            margin-top: 24px;
            color: #fff;
            .link-login {
                color: #1e97fc;
                &:hover {
                    color: #08A7FC;
                    transition: all 0.4s ease;
                }
            }
        }

        .submit-btn {
            display: block;
            margin: 0 auto;
            width: 200px;
            height: 36px;
            line-height: 36px;
        }
    }
}

.m-form-page {
    &--white {
        input, select {
            color: #cccdcd;
            &::-webkit-input-placeholder { /* WebKit browsers */
                color: #999;
            }
            &:-moz-placeholder { /* Mozilla Firefox 4 to 18 */
                color: #999;
            }
            &::-moz-placeholder { /* Mozilla Firefox 19+ */
                color: #999;
            }
            &:-ms-input-placeholder { /* Internet Explorer 10+ */
                color: #999;
            }
        }
    }
}

.m-form-dialog {
    input {
        border: 1px #ccc solid;
        @include placehold-color(#ccc);
        &:hover {
             border: 1px $color-link-hover solid;
        }
    }
    .col-label {
        width: 120px;
        //padding-top: 12px;
        color: #666d71;
        text-align: left;
    }
    .col-input, .col-text {
        width: 244px;
    }
    .modal-body {
        .comp-help {
            margin-bottom: 24px;
        }
    }
    .input--small {
        box-sizing: border-box;
        width: 124px;
        border-right: 0 none;
    }
    .comp-select {
        display: block;
        width: auto;
    }
}

.m-form-tip {
    color: $color-font-gray;
    > ul.list {
        > li.item {
            margin-bottom: 12px;
            &:last-child {
                margin-bottom: 0;
            }
            .item-right {
                float: right;
            }
            .item-left {
                > .text {
                    vertical-align: middle;
                }
                > .comp-popover {
                    display: inline-block;
                    vertical-align: middle;
                }
            }
            &--line {
                margin: -2px 0 10px 0;
                border-bottom: 1px $color-border solid;
            }
        }
    }
}

.m-form-page {
    .col-label {
        width: 128px;
    }
    .col-input, .col-text {
        width: 255px;
        input[type="radio"], input[type="checkbox"] {
            vertical-align: middle;
        }
        .text {
            vertical-align: middle;
        }
    }
    .col-input--unit {
        position: relative;
        input {
            padding-right: 58px;
        }
        .unit {
            position: absolute;
            right: 0;
            width: 50px;
            height: 32px;
            line-height: 32px;
            text-align: center;
        }
    }
    .col-row--tip {
        margin-top: 24px;
        height: 86px;
        line-height: 1.4;
    }
}

// 应用于404和系统维护页面
.m-web {
    margin-top: 128px;
    text-align: center;
    >.txt-top {
        font-size: 13px;
        color: #666666;
        margin: 16px 0;
    }
    >.txt-bottom {
        margin-bottom: 8px;
        font-size: 13px;;
        color: #999999;
    }
}